#pragma once

#include <bofcl_eclic_clicinfo.h>

// ECLIC中clicinfo寄存器定义
typedef struct {
	u32_s interrupt_amount : 13;
	u32_s version : 8;
	u32_s inter_ctl_bit_amount : 4;
	u32_s : 7;
} eclic_clicinfo_expl_s;

_Static_assert(sizeof(eclic_clicinfo_expl_s) == 4,
	       "Struct eclic_clicinfo_expl_s defined error!");

// 获取ECLIC中clicinfo寄存器的值
static inline eclic_clicinfo_expl_s
eclic_get_clicinfo_expl_by_q(u32_s eclic_q) {
	union {
		eclic_clicinfo_expl_s e;
		eclic_clicinfo_s r;
	} er = {
		.r = eclic_rreg_clicinfo_s_by_q(eclic_q),
	};
	return er.e;
}
